package com.bubblegumproject.ogo.swing.util;

import javax.swing.*;
import java.awt.*;

/**
 * Utility methods for working in Swing.
 *
 * @author Azubuko Obele (buko.obele@gmail.com)
 */
public class OgoSwingUtilities {

    public static void center(JFrame frame) {
        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
        Dimension frameSize = frame.getSize();
        frame.setLocation((screenSize.width - frameSize.width) / 2, (screenSize.height  - frameSize.height) / 2);
    }
}
